pci_remove_device: fix linked list discipline
authorTim Deegan <Tim.Deegan@citrix.com>
Fri, 20 May 2011 07:52:22 +0000 (08:52 +0100)
committerTim Deegan <Tim.Deegan@citrix.com>
Fri, 20 May 2011 07:52:22 +0000 (08:52 +0100)
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
xen/drivers/passthrough/pci.c

index e30cd950a399749febd91d56c025338859ae6aa2..1cd82d632f981b0a905078088f11b24ba50669ab 100644 (file)
@@ -173,11 +173,11 @@ out:
 
 int pci_remove_device(u8 bus, u8 devfn)
 {
-    struct pci_dev *pdev;
+    struct pci_dev *pdev, *tmp;
     int ret = -ENODEV;
 
     spin_lock(&pcidevs_lock);
-    list_for_each_entry ( pdev, &alldevs_list, alldevs_list )
+    list_for_each_entry_safe ( pdev, tmp, &alldevs_list, alldevs_list )
         if ( pdev->bus == bus && pdev->devfn == devfn )
         {
             ret = iommu_remove_device(pdev);